import dt from '@dt/dt'
// import table from '@/components/dt/table/render.js'
import table from '@/components/dt/table/render.js'
// import nameOpt from '@/biz/option/name.js'
import tool from "@/common/tool.js"

function options(_this, isAudit = false) {
  return [

    {
      type: 'index',
      field: 'index',
      title: '序号',
      minWidth: 50
    }, {
      title: '工号',
      field: 'workNo',
      minWidth: 120,
    },
    {
      title: '姓名',
      field: 'userName',
      minWidth: 120,
    },
    {
      title: '岗位',
      field: 'postName',
      minWidth: 120,
    }, {
      title: '标准金额（元）',
      field: 'standardMoney',
      minWidth: 120,
    }, {
      title: '发放比例（%）',
      field: 'issuanceRatio',
      minWidth: 120,
    }, {
      title: '标准工作日',
      field: 'standardWork',
      minWidth: 120,
    }, {
      title: '发放月缺勤天数',
      field: 'absentWork',
      minWidth: 120,
    }, {
      title: '是否补发',
      field: 'isReissueStr',
      minWidth: 120,
    }, {
      title: '补发月份',
      field: 'reissueMonth',
      minWidth: 120,
    }, {
      title: '补发津贴（元）',
      field: 'reissueMoney',
      minWidth: 120,
    }, {
      title: '本月津贴（元）',
      field: 'currentMonthMoney',
      minWidth: 120,
    },

    {
      title: '调整金额（元）',
      field: 'adjustMoney',
      minWidth: 120,
      cell: (info) => {
        return {
          edit: {
            key: 'adjustMoney',
            placeholder: '请输入',
            input: {
              type: 'number',
              blur: (val) => {

                _this.updataPrice(info, val)


              },
            },
          }
        }
      },
    }, {
      title: '实发金额（元）',
      field: 'actualMoney',
      minWidth: 120,
      cell: {
        text: { show: true }
      }
    },
    {
      title: '备注',
      field: 'remark',
      minWidth: 120,
      cell: (info) => {
        return {
          edit: {
            key: 'remark',
            placeholder: '请输入',
            input: {
              type: 'text',
              // blur: (val) => {
              //   console.log(info, '11111111111111');
              //   if (val == '') {
              //     _this.$Message.error('备注')
              //     return false
              //   }
              // console.log(info, 'inininininin');
              // _this.updatebonusMoney(val, info)

              // },
            },
          }
        }
      },
      // slots: {
      //   default: (params, h) => {
      //     return table.cell.input(_this, h, {
      //       key: 'name',
      //       data: params.row,
      //     })
      //   }
      // }
      // default: (params, h) => {
      //   return table.cell.input(_this, h, {
      //     key: 'name',
      //     data: params.row,
      //   })
      // }
    },


    {
      title: '操作',
      key: '',
      fixed: 'right',
      width: 180,
      align: 'center',
      slots: {
        default: (params, h) => {
          // let arr = ['店长', '运营策划', '管理员'],
          let arr = [], //指定不可更改编辑的角色
            flag = arr.findIndex((item) => item == params.row.roleName)
          let btns = []
          let item = params.row

          btns.push({
            // title: flag < -1 || _this.unlocking('0202020000') ? '删除' : '',
            title: '删除',
            event: 'detailsDelete',
            data: item
          })

          return table.cell.btns(_this, h, btns)
        }
      },
    },
  ]
}

export default {
  options

}